package com.changgou.controller;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.changgou.entity.Result;
import com.changgou.entity.StatusCode;
import com.changgou.service.PageService;

/**
 * 静态页面生成控制器
 * 
 * @author gaofeng
 * @date 2025年04月28日 16:48
 */
@RestController
@RequestMapping("/page")
public class PageController {
    @Resource
    private PageService pageService;

    /**
     * 生成静态页面
     * 
     * @param id 商品spuId
     * @return 操作结果
     */
    @RequestMapping("/createHtml/{id}")
    public Result createHtml(@PathVariable(name = "id") Long id) {
        pageService.createPageHtml(id);
        return new Result<>(true, StatusCode.OK, "ok");
    }
}
